<?php
    $a="a=heha\hiha";
    $rule='/a=([^(\&|$)]*)/';
    if(preg_match($rule,$a,$rs))
    {
        echo "dung roi";
        echo $rs[1];

    }
    else
        echo "sai roi";
?>